package a.j;

import a.e.c;

import javax.swing.*;
import java.awt.*;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;

public class ae
  extends zd
{
  Icon e = null;
  float f;
  float g;
  public static int h;
  
  public ae() {}
  
  public ae(Icon paramIcon)
  {
    this.e = paramIcon;
  }
  
  public ae(zd paramzd)
  {
    super(paramzd);
    if ((ld.E) || ((paramzd instanceof ae)))
    {
      ae localae = (ae)paramzd;
      this.e = localae.e;
    }
  }
  
  public zd a()
  {
    return new ae(this);
  }
  
  public void a(Icon paramIcon)
  {
    this.e = paramIcon;
    d();
  }
  
  public Icon h()
  {
    return this.e;
  }
  
  public void a(Rectangle2D paramRectangle2D, ld paramld)
  {
    double d1 = i();
    double d2 = j();
    double d3 = a(paramld) - d1 / 2.0D;
    double d4 = b(paramld) - d2 / 2.0D;
    paramRectangle2D.add(d3, d4);
    paramRectangle2D.add(d3 + d1, d4 + d2);
    paramRectangle2D.add(d3, d4 + d2);
    paramRectangle2D.add(d3 + d1, d4);
  }
  
  public boolean a(ld paramld, double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4, Point2D paramPoint2D)
  {
    boolean bool = ld.E;
    if (!bool) {
      if (paramld.b(paramDouble1, paramDouble2, paramDouble3, paramDouble4, paramPoint2D))
      {
        double d1 = Math.max(i(), j());
        double d2 = paramDouble3 - paramPoint2D.getX();
        double d3 = paramDouble4 - paramPoint2D.getY();
        double d4 = d2 * d2 + d3 * d3;
        if (!bool) {
          if (d4 > 0.0D)
          {
            d4 = Math.sqrt(d4);
            d2 = d2 * d1 / d4;
            d3 = d3 * d1 / d4;
            paramPoint2D.setLocation(paramPoint2D.getX() + d2, paramPoint2D.getY() + d3);
            this.f = ((float)(d2 / 2.0D));
            this.g = ((float)(d3 / 2.0D));
          }
        }
        return true;
      }
    }
    return false;
  }
  
  public void a(Graphics2D paramGraphics2D, ld paramld)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    if (!bool2) {
      if (this.e != null)
      {
        if (!bool2) {
          if (this.c.k() == this)
          {
            localPoint2D = this.c.x();
            if (bool2) {
              break label122;
            }
            if (!bool1) {
              break label64;
            }
          }
        }
        Point2D localPoint2D = this.c.y();
        label64:
        this.e.paintIcon(null, paramGraphics2D, (int)(localPoint2D.getX() - i() / 2.0D - this.f), (int)(localPoint2D.getY() - j() / 2.0D - this.g));
        label122:
        if (!bool2)
        {
          if (!this.c.P()) {
            return;
          }
          if (bool2) {
            break label149;
          }
          super.a(paramGraphics2D, paramld);
        }
        if (!bool1) {
          return;
        }
      }
    }
    label149:
    super.a(paramGraphics2D, paramld);
  }
  
  double i()
  {
    if ((ld.E) || (this.e != null)) {
      return this.e.getIconWidth();
    }
    return 1.0D;
  }
  
  double j()
  {
    if ((ld.E) || (this.e != null)) {
      return this.e.getIconHeight();
    }
    return 1.0D;
  }
  
  public boolean a(double paramDouble1, double paramDouble2)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    if (!bool2) {
      if (this.c.k() == this)
      {
        if (bool2) {
          break label52;
        }
        localPoint2D = this.c.x();
        if (!bool1) {
          break label54;
        }
      }
    }
    label52:
    Point2D localPoint2D = this.c.y();
    label54:
    double d1 = localPoint2D.getX() - this.f;
    double d2 = localPoint2D.getY() - this.g;
    if (!bool2) {
      if (d1 - i() / 2.0D <= paramDouble1)
      {
        if (bool2) {
          break label173;
        }
        if (d1 + i() / 2.0D >= paramDouble1)
        {
          if (bool2) {
            break label173;
          }
          if (d2 - j() / 2.0D <= paramDouble2)
          {
            if (bool2) {
              break label173;
            }
            if (d2 + j() / 2.0D >= paramDouble2) {
              return true;
            }
          }
        }
      }
    }
    label173:
    if (!bool2) {
      if (this.c.P())
      {
        if (!bool2) {
          if (this.c.k() == this)
          {
            localld = this.c.h();
            if (bool2) {
              break label254;
            }
            if (!bool1) {
              break label225;
            }
          }
        }
        ld localld = this.c.g();
        label225:
        d1 = a(localld);
        d2 = b(localld);
        label254:
        if (((bool2) || (d1 - i() / 2.0D <= paramDouble1)) && ((bool2) || (d1 + i() / 2.0D >= paramDouble1)) && ((bool2) || (d2 - j() / 2.0D <= paramDouble2))) {
          if (bool2) {}
        }
        return d2 + j() / 2.0D >= paramDouble2;
      }
    }
    return false;
  }
  
  public void a(ObjectOutputStream paramObjectOutputStream)
    throws IOException
  {
    boolean bool = ld.E;
    if (!bool)
    {
      paramObjectOutputStream.writeByte(0);
      super.a(paramObjectOutputStream);
      if (this.e != null) {
        if (!bool)
        {
          if ((this.e instanceof Serializable))
          {
            paramObjectOutputStream.writeBoolean(true);
            if (bool) {
              break label63;
            }
            paramObjectOutputStream.writeObject(this.e);
          }
        }
        else if (!ld.D) {
          return;
        }
      }
    }
    label63:
    paramObjectOutputStream.writeBoolean(false);
  }
  
  public void a(ObjectInputStream paramObjectInputStream)
    throws IOException, ClassNotFoundException
  {
    boolean bool = ld.E;
    if (!bool) {}
    switch (paramObjectInputStream.readByte())
    {
    case 0: 
      super.a(paramObjectInputStream);
      if (!bool)
      {
        if (paramObjectInputStream.readBoolean()) {
          this.e = ((Icon)paramObjectInputStream.readObject());
        }
      }
      else {
        if (!ld.D) {
          break;
        }
      }
      break;
    default: 
      throw new c();
    }
  }
  
  public String toString()
  {
    return "InterfacePort: (" + f() + ',' + g() + ')';
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.j.ae

 * JD-Core Version:    0.7.0.1

 */